

package com.hazelcast.core;

import com.hazelcast.internal.serialization.BinaryInterface;
import com.hazelcast.spi.annotation.NamespacesSupported;

import java.io.Serializable;

/**
 * Represents a function that accepts one argument and produces a result.
 * <p>
 * This class is called IFunction instead of Function to prevent clashes with the one in Java 8.
 * <p>
 * Serialized instances of this interface are used in client-member communication, so changing an implementation's binary format
 * will render it incompatible with its previous versions.
 *
 * @param <T> an argument
 * @param <R> a result
 * @since 3.2
 */
@BinaryInterface
@FunctionalInterface
@NamespacesSupported
public interface IFunction<T, R> extends Serializable {

    R apply(T input);
}
